home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / hopfield.nnc < prev    next >
Text File  |  1993-08-23  |  2KB  |  46 lines

  1. csv3.1    ! Control Strategy Version 3.1
  2. LisaRisa    trace    aux3            ! set up trace function
  3. LisaRisa    lset    in,0            ! read input data
  4. L___Ri_a    io    read
  5. L_saR___    io    lrnin
  6. L_saRi_a    cset    recall,1        ! set initial recall counter
  7. L_saRi_a    lset    in,0            ! start with input layer
  8. L___Ri_a @InLays math    fire|sum|rnoise|tran|output    ! process pre layers
  9. L_saR___    math    fire|sum|lnoise|tran|output
  10. L_saRi_a    lset    cur,1
  11. L_saRi_a    lcmp    out,-1
  12. L_saRi_a    blt    @InLays
  13. L___Ri_a    math    set|fire|tran|output    ! set initial hopfield layer outputs
  14. !L_saRi_a    math    set|fire|tran|output    ! set initial hopfield layer outputs
  15. !                          redundant with what come later
  16. L___R_s_    lset    out,-1
  17. L___R_sa @HopLp    math    sum|rnoise|tran        ! compute new output
  18. L___R_sa    math    output            ! apply it
  19. L___R_sa    io    wrstep            ! pass results to user
  20. L___R_sa    cadd    recall,1        ! next recall count
  21. L___R_sa    fcmp    lflag,36        ! see if EORS or user interrupt
  22. L___R_s_    banz    @HopLpX
  23. L___R_s_    eos
  24. L___R__a    baz    @HopLp            ! loop some more
  25. L___R_sa @HopLpX lset    cur,1            ! point to output layer
  26. L___R_sa    io    rcltst            ! get desired output (test)
  27. L___R_sa    math    fire|sum|ce=e|tran|output|e-=w|swap ! ??? compute new output ???
  28. L___R_sa    io    write            ! write out results
  29. !
  30. !        *** Learning Sequence ***
  31. !
  32. ! We are at the layer before the output layer
  33. L_saR___    math    fire|set|tran|output|e=0    ! out_val = X
  34. L_saR___    lset    out,0            !  error at output layer = Y (D.O)
  35. L_saR___    io    lrnout            ! get desired output
  36. L_saR___    math    fire|backp        ! err_val = Y (D.O.)
  37. L_saR___    lset    out,-1            !  back to hidden layer
  38. L_saR___    math    fire|sum|tran|learn    ! sum_val = W * X
  39. !                        ! dW = (Y - WX) Xt
  40. !                        ! dW = (err_val - sum_val) * out_val
  41. L_saR___    math    fire|output        ! pass it on for posterity
  42. L_saR___    lset    out,0            ! output layer
  43. L_saR___    math    fire|sum|tran|output|e-=w|swap    ! tidy up err & actual output
  44. L_saR___    io    lrnrslt            ! show what we found
  45. LisaRisa   trace    0
  46.